<template>
  <div style="width: 600px">
    <el-row>
      <el-col :span="12" v-for="v in list" :key="v.id" style="marign: 10px;">
        <el-card class="box-card">
          <div slot="header" class="clearfix"  @click="toDetail(v.id)">
            <span>{{ v.title }}</span>
          </div>
          <div class="text item" v-for="i in 5" :key="i">
            <p>第{{ i }}单元</p>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import axios from "axios";
export default {
  created() {
    axios.get("/list").then(resp => {
      console.log(resp.data);
      this.list = resp.data.data;
    });
  },
  data() {
    return {
      list: []
    };
  },
  methods: {
    toDetail(id) {
      console.log(11);
      this.$router.push(`/detail/${id}`);
    }
  }
};
</script>